package com.zhdl.network.duplexprotocol;

import com.zhdl.hardware.robot.kuka.repository.KukaCmdHandleDao;
import org.tio.core.ChannelContext;
import org.tio.core.intf.Packet;
import org.tio.server.intf.TioServerListener;

import javax.annotation.Resource;


/**
 * memoBusTCP事件
 */
public class DuplexServerTcpListener implements TioServerListener {
    public static String SiemensClientIP,SiemensClientPort;

    @Override
    public void onAfterConnected(ChannelContext channelContext, boolean isConnected, boolean isReconnect) throws Exception {
        SiemensClientIP = channelContext.getClientNode().getIp();
        SiemensClientPort = String.valueOf(channelContext.getClientNode().getPort());
    }

    @Override
    public void onAfterDecoded(ChannelContext channelContext, Packet packet, int packetSize) throws Exception {

    }

    @Override
    public void onAfterReceivedBytes(ChannelContext channelContext, int receivedBytes) throws Exception {
    }

    @Override
    public void onAfterSent(ChannelContext channelContext, Packet packet, boolean isSentSuccess) throws Exception {
    }

    @Override
    public void onAfterHandled(ChannelContext channelContext, Packet packet, long cost) throws Exception {
    }

    @Override
    public void onBeforeClose(ChannelContext channelContext, Throwable throwable, String remark, boolean isRemove) throws Exception {
    }

    @Override
    public boolean onHeartbeatTimeout(ChannelContext channelContext, Long aLong, int i) {
        return false;
    }
}
